package com.hb.core.pojo.center.sys.entity;

import com.hb.core.pojo.parent.MPCommonEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 数据字典信息
 * </p>
 *
 * @author zjk
 * @since 2021-05-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_dic_code")
@ApiModel(value = "DicCode对象", description = "数据字典信息")
public class DicCode extends MPCommonEntity {

    @ApiModelProperty(value = "父级ID")
    private Long parentId;

    @ApiModelProperty(value = "类型ID")
    private Long typeId;

    @ApiModelProperty(value = "KEY值, 自增长字段")
    private Integer dicKey;

    @ApiModelProperty(value = "VALUE值")
    private String dicValue;

    @ApiModelProperty(value = "字典值简称")
    private String simpleName;

    @ApiModelProperty(value = "LABEL值")
    private String dicLabel;

    @ApiModelProperty(value = "备注")
    private String note;

    @ApiModelProperty(value = "排序号")
    private Integer sort;

    /**
     * 参数验证方法
     * 所有的继承该类的DTO对象必须在调用时重写该方法
     * 该方法中验证的字段对应数据库中不能为空的字段
     *
     * @param fieldNames
     * @return
     */
    @Override
    public String paramsValid(String... fieldNames) {
        return super.paramsValid("dicValue");
    }
}
